package com.atguigu.easyexcel;

import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.support.ExcelTypeEnum;
import com.atguigu.easyexcel.entity.StudentExcelData;
import com.atguigu.easyexcel.listener.StudentExcelDataListener;
import org.junit.Test;

public class ExcelReadTest {
    @Test
    public void testEasyExcelRead() {
        //ExcelReaderBuilder read(File file, ReadListener readListener)
        StudentExcelDataListener listener = new StudentExcelDataListener() ;
        EasyExcel.read("C:/Users/push/Desktop/file/excel/easyExcelDemo"+ ExcelTypeEnum.XLSX.getValue())
                .registerReadListener(listener)
                .head(StudentExcelData.class)
                .sheet(0)
                .doRead();

        /*System.out.println(listener.getData().size()+","+listener.getData().get(0));*/
    }
}
